/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package estates;

import com.sun.rave.web.ui.appbase.AbstractRequestBean;
import javax.faces.FacesException;
import java.util.HashMap;

/**
 * <p>Request scope data bean for your application.  Create properties
 *  here to represent data that should be made available across different
 *  pages in the same HTTP request, so that the page bean classes do not
 *  have to be directly linked to each other.</p>
 *
 * <p>An instance of this class will be created for you automatically,
 * the first time your application evaluates a value binding expression
 * or method binding expression that references a managed bean using
 * this class.</p>
 *
 * @version RequestBean1.java
 * @version Created on 2011-03-31, 14:53:08
 * @author Przemek
 */

public class RequestBean1 extends AbstractRequestBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }
    // </editor-fold>



    private String oferta;

    private String uzytkownik;

    private String komunikat;
    private String napis;

    private String searchString;
    private boolean viewResults = false;
    private int queryType = 0;

    private HashMap<String,Object> searchQuery = new HashMap<String,Object>();

    public HashMap<String,Object> getSearchQuery() {
        return searchQuery;
    }

    public void setSearchQuery(HashMap<String,Object> searchQuery) {
        this.searchQuery = searchQuery;
    }

    public int getQueryType() {
        return queryType;
    }

    public void setQueryType(int queryType) {
        this.queryType = queryType;
    }



    public String getSearchString() {
        return searchString;
    }

    public void setSearchString(String searchString) {
        this.searchString = searchString;
    }

    public boolean isViewResults() {
        return viewResults;
    }

    public void setViewResults(boolean viewResults) {
        this.viewResults = viewResults;
    }

    boolean showRegon = false;
    boolean showPesel = true;

    public boolean isShowPesel() {
        return showPesel;
    }

    public void setShowPesel(boolean showPesel) {
        this.showPesel = showPesel;
    }

    public boolean isShowRegon() {
        return showRegon;
    }

    public void setShowRegon(boolean showRegon) {
        this.showRegon = showRegon;
    }


    

    public String getNapis() {
        return napis;
    }

    public void setNapis(String napis) {
        this.napis = napis;
    }

    public String getUzytkownik() {
        return uzytkownik;
    }

    public void setUzytkownik(String uzytkownik) {
        this.uzytkownik = uzytkownik;
    }



    public String getKomunikat() {
        return komunikat;
    }

    public void setKomunikat(String komunikat) {
        this.komunikat = komunikat;
    }



    public String getOferta() {
        return oferta;
    }

    public void setOferta(String oferta) {
        this.oferta = oferta;
    }

    boolean panelOfertaDisabled = false;
    boolean panelBudynekDisabled = false;
    boolean panelLokalDisabled = true;
    boolean panelLokalVisible = false;

    public boolean isPanelLokalVisible() {
        return panelLokalVisible;
    }

    public void setPanelLokalVisible(boolean panelLokalVisible) {
        this.panelLokalVisible = panelLokalVisible;
    }



    public boolean isPanelBudynekDisabled() {
        return panelBudynekDisabled;
    }

    public void setPanelBudynekDisabled(boolean panelBudynekDisabled) {
        this.panelBudynekDisabled = panelBudynekDisabled;
    }

    public boolean isPanelLokalDisabled() {
        return panelLokalDisabled;
    }

    public void setPanelLokalDisabled(boolean panelLokalDisabled) {
        this.panelLokalDisabled = panelLokalDisabled;
    }

    public boolean isPanelOfertaDisabled() {
        return panelOfertaDisabled;
    }

    public void setPanelOfertaDisabled(boolean panelOfertaDisabled) {
        this.panelOfertaDisabled = panelOfertaDisabled;
    }

    

    


    /**
     * <p>Construct a new request data bean instance.</p>
     */
    public RequestBean1() {
    }

    /**
     * <p>This method is called when this bean is initially added to
     * request scope.  Typically, this occurs as a result of evaluating
     * a value binding or method binding expression, which utilizes the
     * managed bean facility to instantiate this bean and store it into
     * request scope.</p>
     * 
     * <p>You may customize this method to allocate resources that are required
     * for the lifetime of the current request.</p>
     */
    @Override
    public void init() {
        
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        
        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("RequestBean1 Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>This method is called when this bean is removed from
     * request scope.  This occurs automatically when the corresponding
     * HTTP response has been completed and sent to the client.</p>
     * 
     * <p>You may customize this method to clean up resources allocated
     * during the execution of the <code>init()</code> method, or
     * at any later time during the lifetime of the request.</p>
     */
    @Override
    public void destroy() {
    }
    
    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1) getBean("SessionBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }

}
